using System.Collections.Generic;

namespace ActorSystem
{
    public class BuffSystem : IActorSystem
    {
        public List<BuffBase> buffs;

        public void Initialize()
        {
            buffs = new();
        }

        public void Update()
        {
            for (int i = 0; i < buffs.Count; i++)
            {
                if (!buffs[i].OnUpdate())
                {
                    buffs.RemoveAt(i);
                    if (i >= 0) i--;
                }
            }
        }
    }
}